Computer Graphics (namespace CG)


Brush
Brush()
Brush(COLORREF color)
HBRUSH CreateHatch(int hatchStyle, COLORREF color)
hatchStyle: HS_BDIAGONAL, HS_CROSS, HS_DIAGCROSS, HS_FDIAGONAL, HS_HORIZONTAL, HS_VERTICAL It creates a hatch brush  Google Microsoft
HBRUSH CreatePattern(HINSTANCE hInstance, const wchar_t* pszBitmap)
It creates a solid brush  Google Microsoft
HBRUSH CreateSolid(COLORREF color)
It creates a solid brush  Google Microsoft
HBRUSH GetHBRUSH()
const LOGBRUSH& GetLogBrush() const
virtual ~ Brush(void)
void Delete()

DDBitmap: A device dependent bitmap
DDBitmap& operator =(const DDBitmap& init)
DDBitmap(const DDBitmap& init)
DDBitmap(void)
HBITMAP CreateFromBits(int width, int height, int nPlanes, int nBitCount, DWORD* bits)
HBITMAP CreateFromDIB(HDC hdc, CG::DIBitmap& dib)
HBITMAP CreateFromDIB(HWND hWnd, CG::DIBitmap& dib)
HBITMAP CreateFromDesktop()
HBITMAP CreateFromWindow(HWND hWnd, int x, int y, int width, int height)
It creates a bitmap from a window. The window must be completely visible If the function succeeds, the return value is a handle to the compatible bitmap (DDB). If the function fails, the return value is nullptr
HBITMAP CreateWinPredefined(UINT idOBM)
Add the following line to stdafx.h ->  Google Microsoft
HBITMAP GetHBITMAP()
HBITMAP Strech(int scaleX, int scaleY)
HDC CreateCompatible(HDC hdc, int width, int height)
HDC CreateCompatible(HWND hWnd, int width, int height)
HDC CreateCompatibleFromBits(HDC hdc, int width, int height, DWORD* bits)
HDC CreateCompatibleFromBits(HWND hWnd, int width, int height, DWORD* bits)
HDC GetBitmapDC()
bool CopyPixels(RGBQUAD* out_pixels)
const size_t count = bitmap.GetWidth()*bitmap.GetHeight(); RGBQUAD* pixels = new RGBQUAD[count]; bitmap.CopyPixels(pixels); Do someting with pixels delete [] pixels;
bool CopyPixels(Sys::ColorRGBA* out_pixels)
const size_t count = bitmap.GetWidth()*bitmap.GetHeight(); CG::Color* pixels = new CG::Color[count]; bitmap.CopyPixels(pixels); Do someting with pixels delete [] pixels;
bool CreateFromFile(const wchar_t* filename)
It loads a Device Dependent Bitmap or a Device Independent Bitmap
bool CreateFromResource(HINSTANCE hInstance, int bitmap_id)
bool CreateFromWindow(HWND hWnd, bool clientEdge)
It creates a bitmap from a window. The window must be completely visible
bool CreateFromWindow(HWND hWnd, bool clientEdge, bool lockUpdate)
It creates a bitmap from a window. The window must be completely visible
bool CreateMonochrome(int width, int height)
bool ExportImageRGBA(CG::ImageRGBA& out_image, size_t rectWidth, size_t rectHeight)const
It exports a rectangular area (specified by rectWidth and rectHeight) of the image to export the full image set rectWidth = ddbitmap.GetWidth() and rectHeight = ddbitmap.GetHeight(); out_image.pixel[].alpha = luminance(pixel);
bool ExportToDIB(CG::DIBitmap& out_bitmap)const
bool ExtractPixels(vector<valarray<COLORREF>>& output)
bool IsValid()
bool SaveBMP(const wchar_t* filename)
int GetHeight()
int GetWidth()
virtual ~ DDBitmap(void)
void Create(HBITMAP hBitmap)
void Delete()
void DeleteMemDC()

DIBitmap: It loads a BMP file that can be displayed using CG::Gdi::DrawBitmap (Device Independent Bitmap)
BITMAPINFO& GetBitmapInfo()
DIBitmap()
DIBitmap(const CG::DIBitmap& init)
bool CopyPixels(RGBTRIPLE* out_pixels)const
This functions only works for uncompress bitmaps with 24 or 32 bits/pixel. Each pixel requires 4 bytes const size_t count = bitmap.GetWidth()*bitmap.GetHeight(); RGBTRIPLE* pixels = new RGBTRIPLE[count]; bitmap.CopyPixels(pixels); Do someting with pixels delete [] pixels;
bool CopyPixels(Sys::ColorRGBA* out_pixels)
This functions only works for uncompress bitmaps with 24 or 32 bits/pixel. Each pixel requires 4 bytes const size_t count = bitmap.GetWidth()*bitmap.GetHeight(); Sys::ColorRGBA* pixels = new Sys::ColorRGBA[count]; bitmap.CopyPixels(pixels); Do someting with pixels delete [] pixels;
bool CopyToClipboard(HWND hWnd)
bool Create(size_t bitsPerPixel, size_t numColorsInTableColor, size_t width, size_t height, bool inverted)
After calling Create, you must set the bits using bitmap.GetBits();
bool Export(CG::ImageRGBA& output)
bool ExportToTensor(Sys::Tensor& output)
bool GetASCIIHexDecode(string& output)
bool GetBlackWhitePixels(vector<valarray<unsigned char>>& out_pixels)const
bool GetColorTable(valarray<RGBQUAD >& out_colorTable)const
bool GetLZWDecode(string& output)
bool GetPixels(vector<valarray<COLORREF>>& out_pixels)const
bool HasColorTable() const
bool IsInverted() const
bool IsValid()
bool PasteFromClipboard(HWND hWnd)
bool SaveJpg(int quality, Sys::Buffer& out_jpgImage)
quality from 0 to 100
bool SaveJpg(int quality, const wchar_t* filename)
quality from 0 to 100
bool SetColor(unsigned __int8 red, unsigned __int8 green, unsigned __int8 blue)
bool SetColorTable(const valarray<RGBQUAD >& colorTable)
bool SetColorTableColor(int index, const RGBQUAD& color)
bool SetGrayColorTable(bool inverted)
It sets the color table for eight bits (256 gray levels) black and white images
bool SwapRedAndBlue()
const CG::DIBitmap& operator =(const CG::DIBitmap& init)
const wchar_t* CompressBitmap(int outputNumColors, CG::DIBitmap& output)
From an uncompress 24 bits/pixel image, it creates a new CG::DIBitmap with a different number of colors If outputNumColors is 0, the number of colors is automatically set to 16, 256 or 16,777,216 If outputNumColors is 1, the number of colors is automatically set to 16 or 256 If outputNumColors is 16, the output bitmap will have 16 colors If outputNumColors is 256, the output bitmap will have 256 colors
const wchar_t* CropEmptySpace(CG::DIBitmap& output)
It crops the empty space around the image The function works only for an uncompress bitmap with 24 bits/pixels
const wchar_t* Filter(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33, int denominator, int add, CG::DIBitmap& output)const
const wchar_t* ImportPortablePixMap(const wchar_t* ppm_filename)
It imports a PPM Image (only P6 is supported)
const wchar_t* Load(const wchar_t* filename)
It loads a BMP, GIF, PNG or JPG file
const wchar_t* LoadBmp(HINSTANCE hInstance, int resource_id)
It loads BIN a resource (be sure the resource is not BITMAP)
const wchar_t* LoadBmp(const string& in_bmpimage)
const wchar_t* LoadGif(HINSTANCE hInstance, int resource_id)
It loads a BIN resource with a GIF image
const wchar_t* LoadGif(const string& in_gifimage)
const wchar_t* LoadJpg(HINSTANCE hInstance, int resource_id)
It loads a BIN resource with a JPG image. It requires jpeglib.h and jpeg.lib
const wchar_t* LoadJpg(const string& in_jpgimage)
It requires jpeglib.h and jpeg.lib
const wchar_t* LoadPng(const string& in_pngimage)
It requires lodepng.h and lodepng.cpp
const wchar_t* Save(int quality, const wchar_t* filename)
It saves a BMP, GIF, PNG or JPG file quality from 0 to 100 (valid only for JPG)
const wchar_t* SaveBMP(const wchar_t* filename)
const wchar_t* SaveBmp(string& out_bmpimage)
int GetBitsByteCount()
int GetBitsPerPixel() const
int GetColorCountInColorTable() const
int GetCompression() const
BI_RGB An uncompressed format. BI_RLE8 A run-length encoded (RLE) format for bitmaps with 8 bpp. BI_RLE4 An RLE format for bitmaps with 4 bpp. BI_BITFIELDS Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components BI_JPEG BI_PNG  Google Microsoft
int GetHeight() const
int GetWidth() const
size_t GetBytesRowSize()
It returns the stride value to move from one row to the next one
static const wchar_t* ImageFolderToTensor(const wchar_t* foldername, Mt::ThreadLink& threadLink, Sys::TensorArray& output)
It creates a tensor for each image in the folder
static const wchar_t* TensorToBitmap(const Sys::Tensor& input, double scale, double bias, bool grayScale, valarray<CG::DIBitmap >& bitmap)
It creates an array of bitmaps from a tensor array pixels = scale*tensorValue + bias; if grayScale is true, it always returns gray scale bitmaps.
unsigned char* GetBits()
It returns the bits of the bitmap in RGBTRIPLE (3 bytes). If you want to get four bytes, you can use CopyPixels.
virtual ~ DIBitmap()
void Delete()
void GetPixel(const size_t& row, const size_t& col, RGBTRIPLE& out_color)
void GetPixel(const size_t& row, const size_t& col, unsigned char& out_colorIndex)
void SetBits(const unsigned char* bits)
void SetPixel(const size_t& row, const size_t& col, const RGBTRIPLE& color)
void SetPixel(const size_t& row, const size_t& col, const unsigned char& colorIndex)
void SetPixelsToBlack()

DibSection
DibSection()
HDC GetBitmapDC()
bool CreateCompatible(HDC hdc, int width, int height)
bool CreateCompatibleWithScreen(int width, int height)
int GetHeight()
int GetWidth()
void Delete()
void SetTransparency(COLORREF colorTransparency, int alpha)
~ DibSection()

Font
CG::Font& operator =(const CG::Font& init)
Font(const CG::Font& init)
Font(const wchar_t* name, const wchar_t* text, int width, int height)
Font(const wchar_t* name, int size)
Font(const wchar_t* name, wchar_t* text, RECT& rect)
Font(const wstring& name, const wstring& text, RECT& rect)
Font(const wstring& name, const wstring& text, int width, int height)
Font(const wstring& name, int size)
Font(void)
HFONT Create(HDC hdc, const wchar_t* name, double heightPoints, bool bold, bool italic, bool deviceIndependent)
HFONT Create(HDC hdc, const wstring& name, double heightPoints, bool bold, bool italic, bool deviceIndependent)
HFONT Create(HFONT hFont)
HFONT Create(const LOGFONT& logfont)
HFONT Create(const wchar_t* name, const wchar_t* text, int width, int height)
HFONT Create(const wchar_t* name, int size, BYTE pitchAndFamily)
HFONT Create(const wchar_t* name, int size, bool bold, bool italic, bool underline, bool strikeout)
HFONT Create(const wchar_t* name, int size, bool bold, bool italic, int deciDegrees)
HFONT Create(const wstring& name, const wstring& text, int width, int height)
HFONT Create(const wstring& name, int size, bool bold, bool italic, bool underline, bool strikeout)
HFONT Create(const wstring& name, int size, bool bold, bool italic, int angle)
HFONT Create(int charCount, const wchar_t* name, int width, int height)
HFONT Create(int charCount, const wstring& name, int width, int height)
HFONT CreateFromDialog(HWND hDlg, const wchar_t* name, int points, bool bold, bool italic)
HFONT CreateFromDialog(HWND hDlg, const wstring& name, int points, bool bold, bool italic)
HFONT GetHFONT()
const LOGFONT& GetLogFont() const
int GetSize()
static int GetIdealFontSize(const wstring& text, double width, double height)
static void InitializeLogfont(LOGFONT& logfont)
virtual ~ Font(void)
void Delete()
wchar_t* GetName()

Gdi: Provides a set of APIs to draw on a device (the screen, the printer, etc.) using GDI and GDI+ It is possible to draw a bitmap with an alpha channel using AlphaBlend
# ifdef WIN_GDI_PLUS_ON Gdiplus::Graphics& GetGdiPlus()
BOOL Arc(int xLeft, int yTop, int xRight, int yBottom, int xStart, int yStart, int xEnd, int yEnd)
It draws an elliptical arc  Google Microsoft
BOOL BeginPath()
It opens a path bracket  Google Microsoft
BOOL Chord(int xLeft, int yTop, int xRight, int yBottom, int xStart, int yStart, int xEnd, int yEnd)
It draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant). The chord is outlined by using the current pen and filled by using the current brush.  Google Microsoft
BOOL DrawEdge(RECT& rect, UINT edge, UINT grfFlags)
It draws the specified edges of a rectangle to create a raised or sunken effect edge: BDR_RAISEDOUTER BDR_SUNKENOUTER BDR_RAISEDINNER BDR_SUNKENINNER BDR_OUTER BDR_INNER BDR_RAISED BDR_SUNKEN, grfFlags: BF_RECT BF_FLAT BF_LEFT BF_MONO BF_RIGHT BF_SOFT BF_TOP BF_TOPLEFT BF_TOPRIGHT BF_BOTTOMRIGHT BF_ADJUST  Google Microsoft
BOOL DrawFocusRect(RECT& rect)
It draws a rectangle in the style used to indicate that the rectangle has the focus  Google Microsoft
BOOL DrawTextEx(wchar_t* text, RECT& rect, UINT uFormat, LPDRAWTEXTPARAMS pDrawTextParams)
It draws formatted text in the specified rectangle. The text alignment mode for the device context must include the TA_LEFT, TA_TOP, and TA_NOUPDATECP flags DT_BOTTOM, DT_CALCRECT,DT_CENTER,DT_EDITCONTROL, DT_END_ELLIPSIS, DT_EXPANDTABS, DT_EXTERNALLEADING DT_HIDEPREFIX, DT_INTERNAL, DT_LEFT, DT_MODIFYSTRING, DT_NOCLIP, DT_NOFULLWIDTHCHARBREAK, DT_NOPREFIX, DT_PATH_ELLIPSIS, DT_PREFIXONLY, DT_RIGHT, DT_SINGLELINE, DT_TABSTOP DT_TOP, DT_VCENTER, DT_WORDBREAK, DT_WORD_ELLIPSIS  Google Microsoft
BOOL EndPath()
It closes a path bracket and selects the path defined  Google Microsoft
BOOL FillPath()
It closes any open figures in the current path and fills the path's interior by using the current brush and polygon-filling mode  Google Microsoft
BOOL FlattenPath()
It transforms any curves in the path that is selected, turning each curve into a sequence of lines  Google Microsoft
BOOL InvertRect(const RECT* rect)
It inverts a rectangle in a window by performing a logical NOT operation on the color values for each pixel in the rectangle's interior.  Google Microsoft
BOOL Pie(int xLeft, int yTop, int xRight, int yBottom, int xStart, int yStart, int xEnd, int yEnd)
It draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials. The pie is outlined by using the current pen and filled by using the current brush.  Google Microsoft
BOOL Rectangle(const RECT& rect)
It draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush  Google Microsoft
BOOL Rectangle(int xLeft, int yTop, int xRight, int yBottom)
It draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush  Google Microsoft
BOOL RoundRect(RECT& rect, int xCornerEllipse, int yCornerEllipse)
It draws a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush.  Google Microsoft
BOOL RoundRect(int xLeft, int yTop, int xRight, int yBottom, int xCornerEllipse, int yCornerEllipse)
It draws a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush.  Google Microsoft
BOOL StrokeAndFillPath()
It closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush  Google Microsoft
BOOL StrokePath()
It renders the specified path by using the current pen  Google Microsoft
BOOL TabbedTextOut(int x, int y, const wchar_t* pszString, int nCount, int nTabPositions, int* pcInt, int nTabOrigin)
It writes a character string at a specified location, expanding tabs to the values specified in an array of tab-stop positions. Text is written in the currently selected font, background color, and text color. Google Microsoft
COLORREF GetBkColor()
It returns the current background color  Google Microsoft
COLORREF GetPixel_(int x, int y)
It retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates  Google Microsoft
COLORREF GetTextColor()
It returns the text color  Google Microsoft
COLORREF SetBkColor(COLORREF color)
It sets the current background color to the specified color value, or to the nearest physical color  Google Microsoft
COLORREF SetPixel(int x, int y, COLORREF color)
It sets the pixel at the specified coordinates to the specified color  Google Microsoft
COLORREF SetTextColor(COLORREF color)
It sets text color  Google Microsoft
Gdi(CG::DDBitmap& ddbitmap, RECT rcPaint, bool createGdiplusObject)
Gdi(CG::DibSection& dibSection, bool createGdiplusObject)
Gdi(CG::Metafile& metafile, bool createGdiplusObject)
Gdi(HWND hWnd, CG::Region& clippingRegion, int dcx_flags, bool createGdiplusObject)
dcx_flags: DCX_WINDOW, DCX_CACHE, DCX_NORESETATTRS, DCX_CLIPCHILDREN, DCX_CLIPSIBLINGS DCX_PARENTCLIP, DCX_EXCLUDERGN, DCX_INTERSECTRGN, DCX_EXCLUDEUPDATE, DCX_INTERSECTUPDATE DCX_LOCKWINDOWUPDATE, DCX_VALIDATE
Gdi(HWND hWnd, HRGN hRgn, int dcx_flags, bool createGdiplusObject)
dcx_flags: DCX_WINDOW, DCX_CACHE, DCX_NORESETATTRS, DCX_CLIPCHILDREN, DCX_CLIPSIBLINGS DCX_PARENTCLIP, DCX_EXCLUDERGN, DCX_INTERSECTRGN, DCX_EXCLUDEUPDATE, DCX_INTERSECTUPDATE DCX_LOCKWINDOWUPDATE, DCX_VALIDATE
Gdi(HWND hWnd, bool bOnPaint, bool createGdiplusObject)
Gdi(PAINTSTRUCT& ps, bool createGdiplusObject)
Gdi(Sys::Graphics& graphics, bool createGdiplusObject)
HBRUSH Select(CG::Brush& brush)
It selects a brush  Google Microsoft
HBRUSH SelectBlackBrush()
It selects the black brush  Google Microsoft
HBRUSH SelectBrush__(HBRUSH hBrush)
It selects a brush  Google Microsoft
HBRUSH SelectDarkGrayBrush()
It selects the dark gray brush  Google Microsoft
HBRUSH SelectGrayBrush()
It selects the gray brush  Google Microsoft
HBRUSH SelectHollowBrush()
It selects the hollow brush  Google Microsoft
HBRUSH SelectLightGrayBrush()
It selects the light gray brush  Google Microsoft
HBRUSH SelectNullBrush()
It selects the null brush to paint objects whithout altering the backgroun  Google Microsoft
HBRUSH SelectWhiteBrush()
It selects the white brush  Google Microsoft
HDC GetHDC()
It returns the internal handle to the device context (hdc)  Google Microsoft
HFONT Select(CG::Font& font)
It selects a font  Google Microsoft
HFONT SelectFont__(HFONT hFont)
It selects a font  Google Microsoft
HGDIOBJ SelectObject(HGDIOBJ hgdiobj)
It selects a GDI Object  Google Microsoft
HPEN Select(CG::Pen& pen)
It selects a pen  Google Microsoft
HPEN SelectBlackPen()
It selects the black pen  Google Microsoft
HPEN SelectNullPen()
It selects the null pen to paint objects without borders  Google Microsoft
HPEN SelectPen__(HPEN hPen)
It selects a pen  Google Microsoft
HPEN SelectWhitePen()
It selects the white pen  Google Microsoft
PAINTSTRUCT& GetPaintStruct()
bool AlphaBlend(int xoriginDest, int yoriginDest, int wDest, int hDest, CG::Gdi& source, int xoriginSrc, int yoriginSrc, int wSrc, int hSrc, BLENDFUNCTION ftn)
bool AlphaBlend(int xoriginDest, int yoriginDest, int wDest, int hDest, HDC hdcSrc, int xoriginSrc, int yoriginSrc, int wSrc, int hSrc, BLENDFUNCTION ftn)
bool BitBlt(int xDest, int yDest, int width, int height, CG::Gdi& source, int xSrc, int ySrc, DWORD rop)
rop: BLACKNESS, CAPTUREBLT, DSTINVERT, MERGECOPY, MERGEPAINT, NOMIRRORBITMAP NOTSRCCOPY, NOTSRCERASE, PATCOPY, PATINVERT, PATPAINT, SRCAND, SRCCOPY SRCERASE, SRCINVERT, SRCPAINT, WHITENESS It performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context  Google Microsoft
bool BitBlt(int xDest, int yDest, int width, int height, HDC hdcSrc, int xSrc, int ySrc, DWORD rop)
rop: BLACKNESS, CAPTUREBLT, DSTINVERT, MERGECOPY, MERGEPAINT, NOMIRRORBITMAP NOTSRCCOPY, NOTSRCERASE, PATCOPY, PATINVERT, PATPAINT, SRCAND, SRCCOPY SRCERASE, SRCINVERT, SRCPAINT, WHITENESS It performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context  Google Microsoft
bool Circle(double centerX, double centerY, double radius)
bool DPtoLP(POINT* in_out_points, int pointCount)
It converts device units into logical units  Google Microsoft
bool DPtoLP(RECT& in_out_rect)
It converts device units into logical units  Google Microsoft
bool DoRcPaintOverlap(RECT& rect)
It returns true when the input rectangle overlaps with the paint rectangle  Google Microsoft
bool DrawBitmap(CG::DDBitmap& ddbitmap, const RECT& rect, CG::DDBitmap& monochromeMask)
bool DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, int alpha)
alphaTransparency from 0 to 255. When alpha is 255, it draws a bitmap with an alpha channel (32 bits/pixel)
bool DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, int width, int height, CG::DDBitmap& monochromeMask)
bool DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, int width, int height, int alpha)
alphaTransparency from 0 to 255. When alpha is 255, it draws a bitmap with an alpha channel (32 bits/pixel)
bool DrawDibSection(CG::DibSection& dibsection, int x, int y)
bool DrawDibSection(CG::DibSection& dibsection, int x, int y, int width, int height)
bool DrawFrameRegion(CG::Region& region, CG::Brush& brush, int width, int height)
It draws a border around the specified region by using the specified brush.  Google Microsoft
bool DrawFrameRegion(HRGN hRgn, Brush& brush, int xFrame, int yFrame)
It draws a border around the specified region by using the specified brush.  Google Microsoft
bool DrawFrameRegion(HRGN hRgn, HBRUSH hBrush, int xFrame, int yFrame)
It draws a border around the specified region by using the specified brush.  Google Microsoft
bool DrawIcon(HIMAGELIST imageList, int index, int x, int y)
It draws an icon from an Image List.  Google Microsoft
bool DrawIcon(HIMAGELIST imageList, int index, int x, int y, int dx, int dy, COLORREF backColor, COLORREF foregroundColor, UINT style)
bool DrawIcon(int x, int y, HICON hIcon)
It draws an icon  Google Microsoft
bool DrawIcon(int x, int y, HICON hIcon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)
bool DrawIcon(int x, int y, Sys::Icon& icon)
It draws an icon. The width and height are the same as those provided when loading the icon. If the width and height of the icon were not provided when loading the icon, the default size for the DPI will be used  Google Microsoft
bool DrawIcon(int x, int y, Sys::Icon& icon, CG::Brush& brushBackground)
It draws an icon. The width and height are the same as those provided when loading the icon. If the width and height of the icon were not provided when loading the icon, the default size for the DPI will be used  Google Microsoft
bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, CG::Brush& brushBackground)
It draws an icon. The width and height provided here may produce the icon to scale.  Google Microsoft
bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)
It draws an icon. The width and height provided here may produce the icon to scale. flags: DI_DEFAULTSIZE, DI_IMAGE, DI_MASK, DI_NOMIRROR, DI_NORMAL  Google Microsoft
bool Ellipse(int xLeft, int yTop, int xRight, int yBottom)
It draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.  Google Microsoft
bool ExtTextOut(int x, int y, UINT uOptions, RECT& rect, const wchar_t* pszText, int nCount, const int* pxDistance)
It draws text using the currently selected font, background color, and text color. You can optionally provide dimensions to be used for clipping, opaquing, or both, uOptions: ETO_CLIPPED, ETO_GLYPH_INDEX, ETO_IGNORELANGUAGE, ETO_NUMERICSLATIN, ETO_NUMERICSLOCAL ETO_OPAQUE, ETO_PDY, ETO_RTLREADING  Google Microsoft
bool FillRegion(CG::Region& region, CG::Brush& brush)
It fills a region by using the specified brush  Google Microsoft
bool FillRegion(HRGN hRgn, Brush& brush)
It fills a region by using the specified brush  Google Microsoft
bool FillRegion(HRGN hRgn, HBRUSH hBrush)
It fills a region by using the specified brush  Google Microsoft
bool GetOutlineTextMetrics(CG::OutlineTextMetrics& out_textMetric)
It returns advanced metrics about the font such as average char width, etc. Google Microsoft
bool GetTextExtentPoint32(const wchar_t* text, SIZE& out_size)
It returns the size (width and height) of the specified text  Google Microsoft
bool GetTextExtentPoint32(const wstring& text, SIZE& out_size)
It returns the size (width and height) of some text  Google Microsoft
bool GetTextMetrics(TEXTMETRIC& out_textMetric)
It returns metrics about the font such as average char width, etc. Google Microsoft
bool GetViewportExtEx(SIZE& out_viewportExt)
It retrieves the x-extent and y-extent of the current viewport  Google Microsoft
bool GetViewportOrgEx(POINT& out_viewportOrg)
It retrieves the x-coordinates and y-coordinates of the viewport origin (pixels)  Google Microsoft
bool GetWindowExtEx(SIZE& out_windowExt)
It retrieves the x-extent and y-extent of the window  Google Microsoft
bool GetWindowOrgEx(POINT& out_windowOrg)
It retrieves the x-coordinates and y-coordinates of the window origin (logical units)  Google Microsoft
bool GradientFillRect(const RECT& rect, COLORREF colorLeftTop, COLORREF colorLeftBottom, COLORREF colorRightTop, COLORREF colorRightBottom)
bool GradientFillRectH(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)
vertex includes an arrays of points with their respective colors rectangles is an array of indexes that contains which indexes in vertex are used for each rectangle It fills an array of rectangles using a smooth color transition.  Google Microsoft
bool GradientFillRectH(const RECT& rect, COLORREF colorLeft, COLORREF colorRight)
bool GradientFillRectV(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)
vertex includes an arrays of points with their respective colors rectangles is an array of indexes that contains which indexes in vertex are used for each rectangle It fills an array of rectangles using a smooth color transition.  Google Microsoft
bool GradientFillRectV(const RECT& rect, COLORREF colorTop, COLORREF colorBottom)
bool GradientFillTriangle(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_TRIANGLE* triangles, unsigned int numTriangles)
vertex includes an arrays of points with their respective colors triangles is an array of indexes that contains which indexes in vertex are used for each triangle It fills an array of triangles using a smooth color transition.  Google Microsoft
bool InvertRegion(CG::Region& region)
It inverts the colors in the specified region  Google Microsoft
bool InvertRegion(HRGN hRgn)
It inverts the colors in the specified region  Google Microsoft
bool LPtoDP(POINT* in_out_points, int pointCount)
It converts logical units into device units  Google Microsoft
bool LPtoDP(RECT& in_out_rect)
It converts logical units into device units  Google Microsoft
bool Line(int x1, int y1, int x2, int y2)
It draws a line from the point x1, y1 up to, but not including, the point x2, y2  Google Microsoft
bool LineTo(int nPosX, int nPosY)
It draws a line from the current position up to, but not including, the specified point  Google Microsoft
bool MaskBlt(int xDest, int yDest, int width, int height, CG::Gdi& source, int xSrc, int ySrc, CG::DDBitmap& mask, int xMask, int yMask, DWORD dwRop)
It combines the color data for the source and destination bitmaps using the specified mask and raster operation  Google Microsoft
bool MaskBlt(int xDest, int yDest, int width, int height, HDC hdcSrc, int xSrc, int ySrc, HBITMAP hbmMask, int xMask, int yMask, DWORD dwRop)
It combines the color data for the source and destination bitmaps using the specified mask and raster operation  Google Microsoft
bool MoveToEx(int nPosX, int nPosY)
It updates the current position to the specified point and optionally returns the previous position  Google Microsoft
bool PaintRegion(CG::Region& region)
It paints the specified region by using the brush currently selected  Google Microsoft
bool PaintRegion(HRGN hRgn)
It paints the specified region by using the brush currently selected  Google Microsoft
bool PolyBezier(const POINT* arrayPoints, DWORD numbPoints)
It draws one or more Bezier curves, Start, Control1, Control2, End  Google Microsoft
bool PolyBezier(const Sys::PointArray& pointArray)
It draws one or more Bezier curves, Start, Control1, Control2, End  Google Microsoft
bool PolyBezierTo_(const POINT* arrayPoints, DWORD numbPoints)
It draws one or more Bezier curves, Start, Control1, Control2, End  Google Microsoft
bool PolyPolygon(const POINT* arrayPoints, const int* pointsPerPolygon, int numbPolygons)
It draws a series of closed polygons. Each polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode. The polygons drawn by this function can overlap. pointsPerPolygon is an array with the number of points in each polygon  Google Microsoft
bool PolyPolyline(const POINT* arrayPoints, const DWORD* pointsPerPolyline, DWORD numbPolyline)
It draws multiple series of connected line segments, pointsPerPolygon is an array with the number of points in each polygon  Google Microsoft
bool Polygon(const POINT* arrayPoints, int numbPoints)
It draws a polygon consisting of two or more vertices connected by straight lines. The polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode.  Google Microsoft
bool Polygon(const Sys::PointArray& pointArray)
It draws a polygon consisting of two or more vertices connected by straight lines. The polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode.  Google Microsoft
bool Polyline(const POINT* arrayPoints, int numbPoints)
It draws a series of line segments by connecting the points in the specified array  Google Microsoft
bool Polyline(const Sys::PointArray& pointArray)
It draws a series of line segments by connecting the points in the specified array  Google Microsoft
bool PolylineTo(const POINT* arrayPoints, DWORD numbPoints)
It draws one or more straight lines PolylineTo moves the current position to the ending point of the last line. If the line segments drawn by this function form a closed figure, the figure is not filled.  Google Microsoft
bool SetTextJustification(int breakExtra, int breakCount)
It specifies the amount of space the system should add to the break characters in a string of text. The space is added when an application calls the TextOut or ExtTextOut functions  Google Microsoft
bool SetViewportExtEx(int width, int height, SIZE* prevViewportExtent)
It sets the horizontal and vertical extents of the viewport  Google Microsoft
bool SetViewportOrgEx(int pixelsX, int pixelsY, POINT* prevViewportOrg)
It specifies which device point maps to the window origin (0,0)  Google Microsoft
bool SetWindowExtEx(int width, int height, SIZE* prevWindowExtent)
It sets the horizontal and vertical extents of the window  Google Microsoft
bool SetWindowOrgEx(int luX, int luY, POINT* prevWindowOrg)
It specifies which window point maps to the viewport origin (0,0)  Google Microsoft
bool SetWorldTransformation(const XFORM& transformationMatrix)
It sets a two-dimensional linear transformation between world space and page space for the specified device context. This function requires GDI advanced mode gdi.SetGraphicsMode(GM_ADVANCED); This transformation can be used to scale, rotate, shear, or translate graphics output.  Google Microsoft
bool SetWorldTransformation(double angle, double translationX, double translationY)
It sets a two-dimensional linear transformation between world space and page space for the specified device context. This function requires GDI advanced mode gdi.SetGraphicsMode(GM_ADVANCED); This transformation can be used to rotate or translate graphics output.  Google Microsoft
bool TextOut(int x, int y, const wchar_t* text)
It draws text  Google Microsoft
bool TextOut(int x, int y, const wchar_t* text, int text_length)
It draws text  Google Microsoft
bool TextOut(int x, int y, const wstring& text)
It draws text  Google Microsoft
const RECT& GetRcPaint()
It returns the area that needs to be painted
double GetPixelsPerCentimeter()
Number of pixels per centimeter
double GetPixelsPerMillimeterX()
It retrieves the number of pixels per millimeter in X  Google Microsoft
double GetPixelsPerMillimeterY()
It retrieves the number of pixels per millimeter in Y  Google Microsoft
double GetPixelsPerPoint()
Number of pixels per point (72 points is 1 inch)
int DrawGraphGradientScale(int posX, int posY, int height, double minimum, double maximum, int numTicks, int tickSize, int numColors, bool invertColors)
numColors = 0 for Black and White a maximum of seven colors can be used If tickSize is negative, the ticks are not drawn It returns the width of the painted area
int DrawGraphScaleX(int posX, int posY, int width, double minX, double maxX, int numTicks, int tickSize, const wchar_t* caption)
It draws a scale in the X axis for graph. It returns the height of the painted area
int DrawGraphScaleY(int posX, int posY, int height, double minY, double maxY, int numTicks, int tickSize, const wchar_t* caption)
It draws a scale in the Y axis for graph. It returns the width of the painted area
int DrawGraphScaleYLeft(int posX, int posY, int height, double minY, double maxY, int numTicks, int tickSize, const wchar_t* caption)
It draws a scale in the Y axis for graph. It returns the width of the painted area
int DrawParagraph(const wchar_t* text, int paragraph_width, int x, int y, int alignment)
It prints all lines in a paragraph. It returns the number of lines requiered to display the text in the specified width alignment: WIN_ALIGNMENT_LEFT, WIN_ALIGNMENT_RIGHT, WIN_ALIGNMENT_CENTER, WIN_ALIGNMENT_JUSTIFIED
int DrawText(wchar_t* text, RECT& rect, UINT uFormat)
It draws formatted text in the specified rectangle expanding tabs, justifying characters, breaking lines, and so forth uFormat = DT_LEFT | DT_TOP | DT_WORDBREAK | DT_END_ELLIPSIS | DT_MODIFYSTRING | DT_EDITCONTROL DT_BOTTOM, DT_CALCRECT, DT_CENTER, DT_EDITCONTROL, DT_END_ELLIPSIS, DT_EXPANDTABS, DT_EXTERNALLEADING, DT_HIDEPREFIX, DT_INTERNAL, DT_LEFT, DT_MODIFYSTRING, DT_NOCLIP, DT_NOFULLWIDTHCHARBREAK, DT_NOPREFIX, DT_PATH_ELLIPSIS, DT_PREFIXONLY, DT_RIGHT, DT_RTLREADING, DT_SINGLELINE, DT_TABSTOP, DT_TOP, DT_VCENTER, DT_WORDBREAK, DT_WORD_ELLIPSIS you can use SetTextAlign()  Google Microsoft
int DrawText(wstring& text, RECT& rect, UINT uFormat)
It draws formatted text in the specified rectangle expanding tabs, justifying characters, breaking lines, and so forth uFormat = DT_LEFT | DT_TOP | DT_WORDBREAK | DT_END_ELLIPSIS | DT_MODIFYSTRING | DT_EDITCONTROL DT_BOTTOM, DT_CALCRECT, DT_CENTER, DT_EDITCONTROL, DT_END_ELLIPSIS, DT_EXPANDTABS, DT_EXTERNALLEADING, DT_HIDEPREFIX, DT_INTERNAL, DT_LEFT, DT_MODIFYSTRING, DT_NOCLIP, DT_NOFULLWIDTHCHARBREAK, DT_NOPREFIX, DT_PATH_ELLIPSIS, DT_PREFIXONLY, DT_RIGHT, DT_RTLREADING, DT_SINGLELINE, DT_TABSTOP, DT_TOP, DT_VCENTER, DT_WORDBREAK, DT_WORD_ELLIPSIS you can use SetTextAlign()  Google Microsoft
int FillRect(const RECT& rect, CG::Brush& brush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.  Google Microsoft
int FillRect(const RECT& rect, HBRUSH hBrush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.  Google Microsoft
int FillRect(int xLeft, int yTop, int xRight, int yBottom, CG::Brush& brush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.  Google Microsoft
int FrameRect(const RECT* rect, Brush& brush)
It draws a border around the specified rectangle by using the specified brush. The width and height of the border are always one logical unit.  Google Microsoft
int FrameRect(const RECT* rect, HBRUSH hBrush)
It draws a border around the specified rectangle by using the specified brush. The width and height of the border are always one logical unit.  Google Microsoft
int GetBkMode()
It returns the background mix mode: TRANSPARENT or OPAQUE  Google Microsoft
int GetDeviceCAPS(int index)
It retrieves device-specific information, index: DRIVERVERSION, TECHNOLOGY, HORZSIZE, VERTSIZE, HORZRES, VERTRES, LOGPIXELSX, LOGPIXELSY, BITSPIXEL, PLANES, NUMBRUSHES, NUMPENS, NUMFONTS, NUMCOLORS, ASPECTX, ASPECTY, ASPECTXY, PDEVICESIZE, CLIPCAPS, SIZEPALETTE, NUMRESERVED, COLORRES, PHYSICALWIDTH, PHYSICALHEIGHT, PHYSICALOFFSETX, PHYSICALOFFSETY VREFRESH, SCALINGFACTORX, SCALINGFACTORY, BLTALIGNMENT, SHADEBLENDCAPS, RASTERCAPS, CURVECAPS, LINECAPS POLYGONALCAPS, TEXTCAPS, COLORMGMTCAPS  Google Microsoft
int GetHorizontalDPI()
Number of pixels per logical inch along the screen width  Google Microsoft
int GetMapMode()
It returns the mapping mode  Google Microsoft
int GetPhysicalHeight()
It returns the height of the pritable area and the page. For example, a printer set to print at 600 dpi on 8.5-x11-inch paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.  Google Microsoft
int GetPhysicalOffsetX()
It returns the horizontal offset from the printable area and the page  Google Microsoft
int GetPhysicalOffsetY()
It returns the horizontal offset from the printable area and the page  Google Microsoft
int GetPhysicalScreenHeight_mm()
Height, in millimeters, of the physical screen  Google Microsoft
int GetPhysicalScreenHeight_pixels()
Height, in raster lines, of the screen; or for printers, the height, in pixels, of the printable area of the page. Google Microsoft
int GetPhysicalScreenWidth_mm()
Width, in millimeters, of the physical screen  Google Microsoft
int GetPhysicalScreenWidth_pixels()
Width, in pixels, of the screen; or for printers, the width, in pixels, of the printable area of the page  Google Microsoft
int GetPhysicalWidth()
It returns the width of the pritable area and the page. For example, a printer set to print at 600 dpi on 8.5-x11-inch paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.  Google Microsoft
int GetROP2()
It retrieves the foreground mix mode of the specified device context. The mix mode specifies how the pen or interior color and the color already on the screen are combined to yield a new color.  Google Microsoft
int GetTextFace(int nCount, wchar_t* pszFontName)
It retrieves the typeface name of the font that is selected If the function succeeds, the return value is the number of characters copied to the buffer. If the function fails, the return value is zero.  Google Microsoft
int GetTextWidth(const wchar_t* text)
It returns the width of the specified text  Google Microsoft
int GetVerticalDPI()
Number of pixels per logical inch along the screen height  Google Microsoft
int ParagraphToLines(const wchar_t* text, int paragraph_width, int x, int y, int alignment, vector<CG::TextLine >& out_lines)
It converts a text paragraph into a vector of lines with their positions alignment: WIN_ALIGNMENT_LEFT, WIN_ALIGNMENT_RIGHT, WIN_ALIGNMENT_CENTER, WIN_ALIGNMENT_JUSTIFIED It returns the number of lines requiered to display the text in the specified width
int SaveDC()
It saves the current state of the specified device context (DC) by copying data describing selected objects and graphic modes (such as the bitmap, brush, palette, font, pen, region, drawing mode, and mapping mode) to a context stack. It returns a number than can be used to restore this state by usisng RestoreDC  Google Microsoft
int SelectClippingRegion(CG::Region& region)
It selects a region as the current clipping region. IMPORTANT: the region must be created using device coordinates. You MUST ust LPtoDP to create the region It returns: NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR To remove a device-context's clipping region, specify a nullptr region handle  Google Microsoft
int SelectClippingRegion(HRGN hRgn)
It selects a region as the current clipping region It returns: NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR To remove a device-context's clipping region, specify a nullptr region handle  Google Microsoft
int SetAdvancedMode(bool advanced)
It sets the graphics mode  Google Microsoft
int SetBkMode(bool isTransparent)
It sets the background mix mode  Google Microsoft
int SetDIBitsToDevice(int xDest, int yDest, DWORD widthDest, DWORD heightDest, int heightSource, const VOID* bits, const BITMAPINFO* bitmapInfo)
int SetDIBitsToDevice(int xDest, int yDest, DWORD widthDest, DWORD heightDest, int xSource, int ySource, UINT startScan, UINT scanLines, const VOID* bits, const BITMAPINFO* bitmapInfo, UINT colorUse)
int SetGraphicsMode(int graphicsMode)
It sets the graphics mode for the specified device context: GM_COMPATIBLE or GM_ADVANCED (allows world transformations). If the function succeeds, the return value is the old graphics mode. If the function fails, the return value is zero.  Google Microsoft
int SetMapMode(int nMode)
MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, MM_TWIPS, MM_ISOTROPIC, MM_ANISOTROPIC Google Microsoft
int SetPolyFillMode(bool bWinding)
It sets the polygon fill mode for functions that fill polygons  Google Microsoft
int SetROP2(int nMode)
It sets the current foreground mix mode. GDI uses the foreground mix mode to combine pens and interiors of filled objects with the colors already on the screen. The foreground mix mode defines how colors from the brush or pen and the colors in the existing image are to be combined. R2_COPYPEN is the default, R2_NOTCOPYPEN to invert, R2_WHITE, R2_BLACK, R2_XORPEN for temporary displaying  Google Microsoft
int SetTextCharacterExtra_(int nExtra)
It sets the intercharacter spacing. Intercharacter spacing is added to each character, including break characters, when the system writes a line of text.  Google Microsoft
int StretchDIBits(int xDest, int yDest, int widthDest, int heightDest, int xSource, int ySource, int widthSource, int heightSource, const VOID* bits, const BITMAPINFO* bitmapInfo, UINT colorUse, DWORD rop)
operator HDC&()
operator HDC()
operator RECT()
static bool DoRectOverlap(RECT& rectA, RECT& rectB)
It returns true if the rectangles overlapped  Google Microsoft
static bool Inflate(RECT& rectResult, RECT& rectOriginal, int nAmount)
static double GetMaxScale(const CG::PointF* pfInterior, const CG::PointF* sizeExterior)
unsigned int GetTextAlign()
The GetTextAlign function retrieves the text-alignment setting for the specified device context. It returns a OR combination of: TA_CENTER, TA_LEFT, TA_RIGHT, TA_BASELINE, TA_BOTTOM, TA_TOP, TA_UPDATE_CP If the function fails, the return value is GDI_ERROR.  Google Microsoft
unsigned int SetTextAlign(unsigned int textAlignment)
TA_CENTER, TA_LEFT, TA_RIGHT, TA_BASELINE, TA_BOTTOM, TA_TOP, TA_UPDATE_CP  Google Microsoft
virtual ~ Gdi(void)
void Arc(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a circular arc
void Chord(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a chord (a region bounded by the intersection of a circle and a line segment, called a secant). The chord is outlined by using the current pen and filled by using the current brush.  Google Microsoft
void Cilinder(int x, int y, double radius, double height, bool topEllipse, bool bottomEllipse)
You can select any brush or pen before calling this function
void ColorTextOut(int x, int y, const list<Sys::ColorText >& input, SIZE& output_actualSizeOccupied)
It draws text of several colors
void ColorTextOut(int x, int y, const list<Sys::ColorText >& input, int width, SIZE& output_actualSizeOccupied)
It draws text of several colors
void Delete()
void DrawArrow(const RECT& rect, int direction)
direction: WIN_DRAWARROW_NORTH, WIN_DRAWARROW_EAST, WIN_DRAWARROW_SOUTH, WIN_DRAWARROW_WEST
void DrawBitmap(CG::DDBitmap& ddbitmap, const RECT& rect, COLORREF transparentColor)
void DrawBitmap(CG::DDBitmap& ddbitmap, const RECT& rect, bool isColor)
void DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y)
void DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, COLORREF transparentColor)
void DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, int width, int height, bool isColor, bool maintainAspectRatio)
void DrawBitmap(CG::DDBitmap& ddbitmap, int x, int y, int width, int height, bool maintainAspectRatio, COLORREF transparentColor)
void DrawBitmap(CG::DIBitmap& dibitmap, const RECT& rect, bool isColor)
It fits the bitmap keeping the aspect ratio
void DrawBitmap(CG::DIBitmap& dibitmap, int x, int y)
void DrawBitmap(CG::DIBitmap& dibitmap, int x, int y, int width, int height, bool isColor)
It streches the bitmap without keeping the aspect ratio
void DrawButton(const RECT& rect, bool isUp, bool defaultButton, bool drawGrayBorder, int edgeWidth, COLORREF color)
it draws a button using the specified color If drawGrayBorder is true, edgeWidth must be greater than 2 (i.e., 3, 4, 5, ...) If drawBorder is false, edgeWidth must be greater than 1 (i.e., 2, 3, 4, ...)
void DrawButtonFrame(const RECT& rect, UINT style)
style: DFCS_BUTTONCHECK, DFCS_BUTTONRADIOIMAGE, DFCS_BUTTONRADIOMASK, DFCS_BUTTONRADIO DFCS_BUTTON3STATE, DFCS_BUTTONPUSH OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT  Google Microsoft
void DrawCaptionFrame(const RECT& rect, UINT style)
style: DFCS_CAPTIONCLOSE, DFCS_CAPTIONMIN, DFCS_CAPTIONMAX, DFCS_CAPTIONRESTORE DFCS_CAPTIONHELP OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT  Google Microsoft
void DrawCompatibleBitmap(CG::DDBitmap& ddbitmap, int x, int y)
void DrawCompatibleBitmap(CG::DDBitmap& ddbitmap, int x, int y, int targetWidth, int targetHeight)
void DrawDoubleBuffer(CG::DDBitmap& ddbitmap)
void DrawEdge(const RECT& rect, bool drawGrayBorder, int edgeWidth, COLORREF color, bool raised, unsigned int flags)
It draws the specified edges of a rectangle to create a raised or sunken effect flags BF_RECT BF_LEFT BF_RIGHT BF_TOP BF_BOTTOM i.e. flags = BF_LEFT | BF_RIGHT If drawGrayBorder is true, edgeWidth must be greater than 2 (i.e., 3, 4, 5, ...) If drawGrayBorder is false, edgeWidth must be greater than 1 (i.e., 2, 3, 4, ...)
void DrawFrameControl(const RECT& rect, UINT type, UINT style)
It draws a frame control of the specified type and style  Google Microsoft
void DrawGraphics(Sys::Graphics& graphics, int x, int y)
void DrawGraphics(Sys::Graphics& graphics, int x, int y, int width, int height)
void DrawMenuFrame(const RECT& rect, UINT style)
style: DFCS_MENUARROW, DFCS_MENUCHECK, DFCS_MENUBULLET, DFCS_MENUARROWRIGHT OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT  Google Microsoft
void DrawMetafile(CG::Metafile& metafile, const RECT& rect)
void DrawMetafile(CG::Metafile& metafile, const RECT& rect, bool centered)
void DrawMetafile(CG::Metafile& metafile, int x, int y)
void DrawMetafile(CG::Metafile& metafile, int x, int y, int width)
void DrawScrollFrame(const RECT& rect, UINT style)
style: DFCS_SCROLLUP, DFCS_SCROLLDOWN, DFCS_SCROLLLEFT, DFCS_SCROLLRIGHT DFCS_SCROLLCOMBOBOX, DFCS_SCROLLSIZEGRIP, DFCS_SCROLLSIZEGRIPRIGHT OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT  Google Microsoft
void DrawTriangle(LONG x1, LONG y1, LONG x2, LONG y2, LONG x3, LONG y3, CG::Brush& brush)
void DrawTriangle(POINT* vertices, CG::Brush& brush)
POINT vertices[4]; vertices[0].x = 10; vertices[0].y = 10; vertices[1].x = 100; vertices[1].y = 10; vertices[2].x = 10; vertices[2].y = 100;
void DrawWindowCaption(const RECT& rect, UINT flags)
flags: DC_ACTIVE, DC_BUTTONS, DC_GRADIENT, DC_ICON, DC_INBUTTON, DC_SMALLCAP, DC_TEXT It draws a window caption  Google Microsoft
void FillPolyBezier(const POINT* arrayPoints, DWORD count, CG::Brush& brush)
void FillPolyBezier(const Sys::PointArray& arrayPoint, CG::Brush& brush)
void Pie(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a pie-shaped wedge bounded by the intersection of a circle and two radials. The pie is outlined by using the current pen and filled by using the current brush.  Google Microsoft
void RemoveClippingRegion()
void RestoreDC(int n)
It restores a device context (DC) to the specified state. The DC is restored by popping state information off a stack created by earlier calls to the SaveDC function. To restore the most recently save state use n = -1  Google Microsoft
void SetRcPaint(const RECT& rcPaint)
void SolidCilinder(int x, int y, double radius, double height, COLORREF color)
You may want to select the nullptr pen before calling SolidCilinder
void TextOut(const RECT& rect, const wchar_t* text)
void TextOut(const RECT& rect, const wstring& text)
void TextOutTruncate(int x, int y, const wchar_t* text, int width, bool ellipses, bool centerX)
void TextOutTruncate(int x, int y, const wstring& text, int width, bool ellipses, bool centerX)
Gdiplus::Graphics& Plus

GdiPlusOn
GdiPlusOn(void)
virtual ~ GdiPlusOn(void)

Gif
Gif()
bool HasGlobalColorTable() const
bool IsGIF87a() const
bool IsGIF89a() const
const wchar_t* Create(size_t bitsPerPixel, const valarray<RGBQUAD >& colorTable, size_t width, size_t height, const string& bits)
The size of bits must be height*GetBytesRowSize() Each row must be aligned at GetBytesRowSize()
const wchar_t* Create(size_t bitsPerPixel, const valarray<RGBTRIPLE >& colorTable, size_t width, size_t height, const string& bits)
The size of bits must be height*GetBytesRowSize() Each row must be aligned at GetBytesRowSize()
const wchar_t* Load(HINSTANCE hInstance, int resource_id)
It loads a BIN resource with a GIF image
const wchar_t* Load(const string& in_gifimage)
const wchar_t* Load(const wchar_t* filename)
const wchar_t* Save(const wchar_t* filename)const
double GetDelayTime() const
It returns the delay time in seconds when multiple images
int GetTransparencyColor() const
It returns the index of the transparency color. It return -1, when there is not transparency
size_t GetBitsPerPixel() const
it returns 1, 2, 3, 4, 5, 6, 7, 8
size_t GetBytesRowSize() const
size_t GetColorResolution() const
it returns 2, 4, 8, 16, 32, 64, 128, 256
size_t GetHeight() const
size_t GetNumColorsInTable() const
it returns 2, 4, 8, 16, 32, 64, 128, 256
size_t GetWidth() const
void Delete()
void GetColorTable(valarray<RGBQUAD >& colorTable)const
void SetBitsPerPixel(size_t bitsPerPixel)
bitsPerPixel: 1, 2, 3, 4, 5, 6, 7, 8
void SetColorResolution(size_t colorResolution)
colorResolution: 2, 4, 8, 16, 32, 64, 128, 256
void SetColorTable(const valarray<RGBQUAD >& colorTable)
void SetGifVersion(bool isGif87a)
void SetGlobalColorTable(bool hasGlobalColorTable)
void SetHeight(size_t height)
void SetNumColorsInTable(size_t numColors)
numColors: 2, 4, 8, 16, 32, 64, 128, 256
void SetWidth(size_t width)
~ Gif()
bool GlobalColorTable
size_t ColorResolution
size_t NumColorsInTable
size_t BitsPerPixel
size_t Width
size_t Height

GifCtrlExtBlock
GifCtrlExtBlock()
bool IsTransparent() const
double GetDelayTime() const
void Reset()
void SetDelayTime(double seconds)
void SetTransparent(bool isTransparent)
~ GifCtrlExtBlock()

GifHeader
GifHeader()
bool HasGlobalColorTable() const
bool IsSignatureValid() const
size_t GetBitsPerPixel() const
it returns 1, 2, 3, 4, 5, 6, 7, 8
size_t GetColorResolution() const
it returns 2, 4, 8, 16, 32, 64, 128, 256
size_t GetNumColorsInTable() const
it returns 2, 4, 8, 16, 32, 64, 128, 256
void Reset()
void SetBitsPerPixel(size_t bitsPerPixel)
bitsPerPixel: 1, 2, 3, 4, 5, 6, 7, 8
void SetColorResolution(size_t colorResolution)
colorResolution: 2, 4, 8, 16, 32, 64, 128, 256
void SetGlobalColorTable(bool hasGlobalColorTable)
void SetNumColorsInTable(size_t numColors)
numColors: 2, 4, 8, 16, 32, 64, 128, 256
~ GifHeader()

GifImageBlock
GifImageBlock()
bool HasColorTable() const
bool IsInterlace() const
bool IsSort() const
unsigned int GetNumColors() const
void Reset()
void SetColorTable(bool hasColorTable)
void SetInterlace(bool isInterlance)
void SetNumColors(unsigned int numColors)
void SetSort(bool isSort)
~ GifImageBlock()

GraphicsInfo
GraphicsInfo()
~ GraphicsInfo()

IGdi: Provides a set of APIs to draw on a device (the screen, the printer, etc.) or Create a PDF
virtual BOOL Rectangle(const RECT& rect)= 0
virtual BOOL Rectangle(int xLeft, int yTop, int xRight, int yBottom)= 0
virtual COLORREF GetBkColor() = 0
virtual COLORREF GetTextColor() = 0
virtual COLORREF SetBkColor(COLORREF color)= 0
virtual COLORREF SetPixel(int x, int y, COLORREF color)= 0
virtual COLORREF SetTextColor(COLORREF color)= 0
virtual HBRUSH Select(CG::Brush& brush)= 0
virtual HBRUSH SelectBlackBrush() = 0
virtual HBRUSH SelectBrush__(HBRUSH hBrush)= 0
virtual HBRUSH SelectDarkGrayBrush() = 0
virtual HBRUSH SelectGrayBrush() = 0
virtual HBRUSH SelectHollowBrush() = 0
virtual HBRUSH SelectLightGrayBrush() = 0
virtual HBRUSH SelectNullBrush() = 0
virtual HBRUSH SelectWhiteBrush() = 0
virtual HFONT Select(CG::Font& font)= 0
virtual HFONT SelectFont__(HFONT hFont)= 0
virtual HPEN Select(CG::Pen& pen)= 0
virtual HPEN SelectBlackPen() = 0
virtual HPEN SelectNullPen() = 0
virtual HPEN SelectPen__(HPEN hPen)= 0
virtual HPEN SelectWhitePen() = 0
virtual bool Circle(double centerX, double centerY, double radius)= 0
virtual bool DPtoLP(POINT* in_out_points, int pointCount)= 0
virtual bool DPtoLP(RECT& in_out_rect)= 0
virtual bool DoRcPaintOverlap(RECT& rect)= 0
virtual bool DrawIcon(HIMAGELIST imageList, int index, int x, int y)= 0
virtual bool DrawIcon(HIMAGELIST imageList, int index, int x, int y, int dx, int dy, COLORREF backColor, COLORREF foregroundColor, UINT style)= 0
virtual bool DrawIcon(int x, int y, HICON hIcon)= 0
virtual bool DrawIcon(int x, int y, HICON hIcon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)= 0
virtual bool DrawIcon(int x, int y, Sys::Icon& icon)= 0
virtual bool DrawIcon(int x, int y, Sys::Icon& icon, CG::Brush& brushBackground)= 0
virtual bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, CG::Brush& brushBackground)= 0
virtual bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)= 0
virtual bool Ellipse(int xLeft, int yTop, int xRight, int yBottom)= 0
virtual bool GetTextExtentPoint32(const wchar_t* text, SIZE& out_size)= 0
virtual bool GetTextExtentPoint32(const wstring& text, SIZE& out_size)= 0
virtual bool GetTextMetrics(TEXTMETRIC& out_textMetric)= 0
virtual bool GetViewportExtEx(SIZE& out_viewportExtent)= 0
virtual bool GetViewportOrgEx(POINT& out_viewportOrg)= 0
virtual bool GetWindowExtEx(SIZE& out_windowExtent)= 0
virtual bool GetWindowOrgEx(POINT& out_windowOrg)= 0
virtual bool GradientFillRectH(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)= 0
virtual bool GradientFillRectH(const RECT& rect, COLORREF colorLeft, COLORREF colorRight)= 0
virtual bool GradientFillRectV(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)= 0
virtual bool GradientFillRectV(const RECT& rect, COLORREF colorTop, COLORREF colorBottom)= 0
virtual bool GradientFillTriangle(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_TRIANGLE* triangles, unsigned int numTriangles)= 0
virtual bool LPtoDP(POINT* in_out_points, int pointCount)= 0
virtual bool LPtoDP(RECT& in_out_rect)= 0
virtual bool Line(int x1, int y1, int x2, int y2)= 0
virtual bool LineTo(int x, int y)= 0
virtual bool MoveToEx(int x, int y)= 0
virtual bool PolyBezier(const POINT* arrayPoints, DWORD numbPoints)= 0
virtual bool PolyBezierTo_(const POINT* arrayPoints, DWORD numbPoints)= 0
virtual bool PolyPolygon(const POINT* arrayPoints, const int* pointsPerPolygon, int numbPolygons)= 0
virtual bool PolyPolyline(const POINT* arrayPoints, const DWORD* pointsPerPolyline, DWORD numbPolyline)= 0
virtual bool Polygon(const POINT* arrayPoints, int numbPoints)= 0
virtual bool Polyline(const POINT* arrayPoints, int numbPoints)= 0
virtual bool PolylineTo(const POINT* arrayPoints, DWORD numbPoints)= 0
virtual bool SetViewportExtEx(int width, int height, SIZE* prevViewportExtent)= 0
virtual bool SetViewportOrgEx(int pixelsX, int pixelsY, POINT* prevViewportOrg)= 0
virtual bool SetWindowExtEx(int width, int height, SIZE* prevWindowExtent)= 0
virtual bool SetWindowOrgEx(int luX, int luY, POINT* prevWindowOrg)= 0
virtual bool TextOut(int x, int y, const wchar_t* text)= 0
virtual bool TextOut(int x, int y, const wchar_t* text, int length)= 0
virtual bool TextOut(int x, int y, const wstring& text)= 0
virtual const RECT& GetRcPaint() = 0
virtual double GetPixelsPerCentimeter() = 0
virtual double GetPixelsPerMillimeterX() = 0
virtual double GetPixelsPerMillimeterY() = 0
virtual double GetPixelsPerPoint() = 0
virtual int FillRect(const RECT& rect, CG::Brush& brush)= 0
virtual int FillRect(const RECT& rect, HBRUSH hBrush)= 0
virtual int FillRect(int xLeft, int yTop, int xRight, int yBottom, CG::Brush& brush)= 0
virtual int GetBkMode() = 0
virtual int GetDeviceCAPS(int index)= 0
virtual int GetHorizontalDPI() = 0
virtual int GetPhysicalHeight() = 0
virtual int GetPhysicalOffsetX() = 0
virtual int GetPhysicalOffsetY() = 0
virtual int GetPhysicalScreenHeight_mm() = 0
virtual int GetPhysicalScreenHeight_pixels() = 0
virtual int GetPhysicalScreenWidth_mm() = 0
virtual int GetPhysicalScreenWidth_pixels() = 0
virtual int GetPhysicalWidth() = 0
virtual int GetTextWidth(const wchar_t* text)= 0
virtual int GetVerticalDPI() = 0
virtual int SaveDC() = 0
virtual int SelectClippingRegion(CG::Region& region)= 0
virtual int SetBkMode(bool bTransparent)= 0
virtual unsigned int GetTextAlign() = 0
virtual unsigned int SetTextAlign(unsigned int textAlign)= 0
virtual void Arc(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)= 0
virtual void Chord(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)= 0
virtual void Cilinder(int x, int y, double radius, double height, bool topEllipse, bool bottomEllipse)= 0
virtual void DrawArrow(const RECT& rect, int direction)= 0
virtual void DrawCaptionFrame(const RECT& rect, UINT style)= 0
virtual void DrawFrameControl(const RECT& rect, UINT type, UINT style)= 0
virtual void DrawGraphics(Sys::Graphics& graphics, int x, int y)= 0
virtual void DrawGraphics(Sys::Graphics& graphics, int x, int y, int width, int height)= 0
virtual void DrawMenuFrame(const RECT& rect, UINT style)= 0
virtual void DrawScrollFrame(const RECT& rect, UINT style)= 0
virtual void DrawWindowCaption(const RECT& rect, UINT flags)= 0
virtual void Pie(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)= 0
virtual void RemoveClippingRegion() = 0
virtual void RestoreDC(int state)= 0
virtual void SolidCilinder(int x, int y, double radius, double height, COLORREF color)= 0
virtual void TextOut(const RECT& rect, const wchar_t* text)= 0
virtual void TextOut(const RECT& rect, const wstring& text)= 0

ImageBlitInfo
ImageBlitInfo()
bool Load(Sys::IReader& reader)
bool Save(Sys::IWriter& writer)
void Reset()
~ ImageBlitInfo()

ImageRGBA
COLORREF MixColors(COLORREF color1, COLORREF color2, double rate)
if rate = 0.0, it returns color1, if rate = 1.0, it returns color2
ImageRGBA& operator =(const CG::ImageRGBA& init)
ImageRGBA()
ImageRGBA(const CG::ImageRGBA& init)
Sys::ColorRGBA* GetPixel()
It returns a pointer to the image pixels
bool CopyPixels(RGBTRIPLE* out_pixels)const
const size_t count = bitmap.GetWidth()*bitmap.GetHeight(); RGBTRIPLE* pixels = new RGBTRIPLE[count]; bitmap.CopyPixels(pixels); Do someting with pixels delete [] pixels;
bool Create(size_t width, size_t height)
bool CreateTestPattern(size_t width, size_t height)
bool Export(CG::DIBitmap& output)const
bool Load(const wchar_t* filename)
bool Save(const wchar_t* filename)const
const wchar_t* BitBlit(CG::ImageBlitInfo blipInfo, CG::DIBitmap& destination)const
const wchar_t* Import(const wchar_t* filename)
filename can be PNG, JPG or GIF
size_t GetHeight() const
size_t GetWidth() const
void BitBlit(unsigned int offsetX, unsigned int offsetY, CG::ImageRGBA& destination)const
void Delete()
void SetColor(unsigned __int8 red, unsigned __int8 green, unsigned __int8 blue, bool keepAlphaChannel)
~ ImageRGBA()

JfifApp0
JfifApp0()
bool IsValid()
void CorrectEndianness()
void Reset()
~ JfifApp0()

JpgHuffCode
JpgHuffCode()
~ JpgHuffCode()

JpgImage
JpgImage()
bool Decode(const unsigned char* jpgData, size_t dataLen, CG::DIBitmap& output)
bool Decode(const unsigned char* jpgData, size_t dataLen, CG::ImageRGBA& output)
bool Decode(const wchar_t* filename, CG::DIBitmap& output)
bool Decode(const wchar_t* filename, CG::ImageRGBA& output)
bool Encode(const CG::DIBitmap& input, const wchar_t* filename, unsigned int quality)
bool Encode(const CG::DIBitmap& input, unsigned int quality, Sys::Buffer& output)
bool Encode(const CG::ImageRGBA& input, const wchar_t* filename, unsigned int quality)
bool Encode(const CG::ImageRGBA& input, unsigned int quality, Sys::Buffer& output)
bool Encode(const RGBTRIPLE* in_pixels, int width, int height, bool isYCbCr420, unsigned int quality, Sys::Buffer& output)
void Delete()
~ JpgImage()

Metafile: It provides support to handle metafiles (native vector graphics)
BOOL Enumerate(HDC hdc, const RECT* pRect)
CG::Metafile& operator =(const CG::Metafile& init)
HDC Create()
HDC CreateToFile(HDC hdcRef, RECT* rect, const wchar_t* filename, const wchar_t* description)
hdcRef is used only to get the size and resolution of the Device filename L"C:\\\\Users\\my_image.emf" description L"Wintempla\0Control\0\0"
HDC CreateToFile(HWND hWnd, const wchar_t* filename, int width, int height)
HDC CreateToFile(const wchar_t* filename, int width, int height)
HDC GetHDC()
HENHMETAFILE Close()
HENHMETAFILE GetHandle()
Metafile(const CG::Metafile& init)
Metafile(void)
SIZE GetSizeIn0_01mm(void)
SIZE GetSizeInDeviceUnits(void)
UINT GetHeader(ENHMETAHEADER& header)
bool Create(HENHMETAFILE hEMF)
bool CreateFromResource(HINSTANCE hInstance, int emf_id)
bool Load(const wchar_t* filename)
It loads a *.emf or *.wmf file
static int CALLBACK EmfProc(HDC hdc, HANDLETABLE* phTable, const ENHMETARECORD* pEmfRecord, int nHandles, LPARAM lData)
virtual ~ Metafile(void)
void Delete()

Octree: It generates a color palette from an image
Octree()
void AddColor(const BYTE& red, const BYTE& green, const BYTE& blue)
Call this function for each color in the image
void GeneratePalette(size_t maxColors, vector<RGBQUAD >& out_palette)
Call this function at the end to generate the palette
~ Octree()

OctreeNode: It stores information for the Octree algorithm
OctreeNode& operator +=(const OctreeNode& input)
OctreeNode(bool endNode, Octree* octree)
void BuildPalette(size_t maxColors, vector<RGBQUAD >& out_palette)
void Delete()
void Reduce(size_t minNumPixels)
~ OctreeNode()

OctreeSearch: It is used to find the nearest color palette index
OctreeSearch()
int GetNearestColorIndex(const vector<RGBQUAD >& palette, const BYTE& red, const BYTE& green, const BYTE& blue)
It returns the palette index of the nearest color to the specified color by the values of: red, green and blue
void Create(const vector<RGBQUAD >& palette)
~ OctreeSearch()

OctreeSearchNode: It stores information to find the nearest color
OctreeSearchNode(bool endNode)
int GetPaletteIndex(const vector<RGBQUAD >& palette, const BYTE& red, const BYTE& green, const BYTE& blue, unsigned int& minDistance)
void Delete()
~ OctreeSearchNode()

OutlineTextMetrics
OutlineTextMetrics()
bool Create(HDC hdc)
virtual ~ OutlineTextMetrics()
void Delete()

Palette
Palette()
bool Create(const vector<COLORREF >& input)
bool Create(const vector<RGBQUAD >& input)
int GetNearestIndex(const COLORREF& color)
int GetNearestIndex(const RGBQUAD& color)
int GetNearestIndex(const RGBTRIPLE& color)
void Delete()
~ Palette()

PaletteColor
PaletteColor()
bool operator <(CG::PaletteColor& init)const
~ PaletteColor()

PdfGdi
BOOL Rectangle(const RECT& rect)
It draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush
BOOL Rectangle(int xLeft, int yTop, int xRight, int yBottom)
It draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush
COLORREF GetBkColor()
It returns the current background color
COLORREF GetTextColor()
It returns the text color
COLORREF SetBkColor(COLORREF color)
It sets the current background color
COLORREF SetPixel(int x, int y, COLORREF color)
It sets the pixel at the specified coordinates to the specified color  Google Microsoft
COLORREF SetTextColor(COLORREF color)
It sets text color
HBRUSH Select(CG::Brush& brush)
It selects a brush  Google Microsoft
HBRUSH SelectBlackBrush()
It selects the black brush  Google Microsoft
HBRUSH SelectBrush__(HBRUSH hBrush)
It selects a brush  Google Microsoft
HBRUSH SelectDarkGrayBrush()
It selects the dark gray brush  Google Microsoft
HBRUSH SelectGrayBrush()
It selects the gray brush  Google Microsoft
HBRUSH SelectHollowBrush()
It selects the hollow brush  Google Microsoft
HBRUSH SelectLightGrayBrush()
It selects the light gray brush  Google Microsoft
HBRUSH SelectNullBrush()
It selects the null brush to paint objects whithout altering the backgroun  Google Microsoft
HBRUSH SelectWhiteBrush()
It selects the white brush  Google Microsoft
HFONT Select(CG::Font& font)
It selects a font  Google Microsoft
HFONT SelectFont__(HFONT hFont)
It selects a font  Google Microsoft
HPEN Select(CG::Pen& pen)
It selects a pen  Google Microsoft
HPEN SelectBlackPen()
It selects the black pen  Google Microsoft
HPEN SelectNullPen()
It selects the null pen to paint objects without borders  Google Microsoft
HPEN SelectPen__(HPEN hPen)
It selects a pen  Google Microsoft
HPEN SelectWhitePen()
It selects the white pen  Google Microsoft
Pdf::Page& GetPage()
PdfGdi()
bool Circle(double centerX, double centerY, double radius)
bool DPtoLP(POINT* in_out_points, int pointCount)
It converts device units into logical units
bool DPtoLP(RECT& in_out_rect)
It converts device units into logical units
bool DoRcPaintOverlap(RECT& rect)
bool DrawIcon(HIMAGELIST imageList, int index, int x, int y)
It draws an icon from an Image List
bool DrawIcon(HIMAGELIST imageList, int index, int x, int y, int dx, int dy, COLORREF backColor, COLORREF foregroundColor, UINT style)
bool DrawIcon(int x, int y, HICON hIcon)
It draws an icon
bool DrawIcon(int x, int y, HICON hIcon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)
bool DrawIcon(int x, int y, Sys::Icon& icon)
It draws an icon. The width and height are the same as those provided when loading the icon. If the width and height of the icon were not provided when loading the icon, the default size for the DPI will be used
bool DrawIcon(int x, int y, Sys::Icon& icon, CG::Brush& brushBackground)
It draws an icon. The width and height are the same as those provided when loading the icon. If the width and height of the icon were not provided when loading the icon, the default size for the DPI will be used
bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, CG::Brush& brushBackground)
It draws an icon. The width and height provided here may produce the icon to scale.
bool DrawIcon(int x, int y, Sys::Icon& icon, int width, int height, unsigned int stepIfAnyCur, HBRUSH brushBackground, unsigned int flags)
It draws an icon. The width and height provided here may produce the icon to scale. flags: DI_DEFAULTSIZE, DI_IMAGE, DI_MASK, DI_NOMIRROR, DI_NORMAL
bool Ellipse(int xLeft, int yTop, int xRight, int yBottom)
It draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.  Google Microsoft
bool GetTextExtentPoint32(const wchar_t* text, SIZE& size)
It returns the size (width and height) of the specified text
bool GetTextExtentPoint32(const wstring& text, SIZE& size)
It returns the size (width and height) of the specified text
bool GetTextMetrics(TEXTMETRIC& out_TextMetric)
It returns metrics about the font such as average char width, etc.
bool GetViewportExtEx(SIZE& out_viewportExt)
It retrieves the x-extent and y-extent of the current viewport
bool GetViewportOrgEx(POINT& out_viewportOrg)
It retrieves the x-coordinates and y-coordinates of the viewport origin (pixels)
bool GetWindowExtEx(SIZE& out_windowExtent)
It retrieves the x-extent and y-extent of the window
bool GetWindowOrgEx(POINT& out_windowOrg)
It retrieves the x-coordinates and y-coordinates of the window origin (logical units)
bool GradientFillRectH(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)
vertex includes an arrays of points with their respective colors rectangles is an array of indexes that contains which indexes in vertex are used for each rectangle It fills an array of rectangles using a smooth color transition.
bool GradientFillRectH(const RECT& rect, COLORREF colorLeft, COLORREF colorRight)
bool GradientFillRectV(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_RECT* rectangles, unsigned int numRectangles)
vertex includes an arrays of points with their respective colors rectangles is an array of indexes that contains which indexes in vertex are used for each rectangle It fills an array of rectangles using a smooth color transition.
bool GradientFillRectV(const RECT& rect, COLORREF colorTop, COLORREF colorBottom)
bool GradientFillTriangle(TRIVERTEX* vertex, unsigned int numVertex, GRADIENT_TRIANGLE* triangles, unsigned int numTriangles)
vertex includes an arrays of points with their respective colors triangles is an array of indexes that contains which indexes in vertex are used for each triangle It fills an array of triangles using a smooth color transition.
bool LPtoDP(POINT* in_out_points, int pointCount)
It converts logical units into device units
bool LPtoDP(RECT& in_out_rect)
It converts logical units into device units
bool Line(int x1, int y1, int x2, int y2)
It draws a line from the current position up tothe specified point
bool LineTo(int x, int y)
It draws a line from the current position up to the specified point
bool MoveToEx(int x, int y)
It updates the current position to the specified point
bool PolyBezier(const POINT* arrayPoints, DWORD numbPoints)
It draws one or more Bezier curves, Start, Control1, Control2, End  Google Microsoft
bool PolyBezierTo_(const POINT* arrayPoints, DWORD numbPoints)
It draws one or more Bezier curves, Start, Control1, Control2, End  Google Microsoft
bool PolyPolygon(const POINT* arrayPoints, const int* pointsPerPolygon, int numbPolygons)
It draws a series of closed polygons. Each polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode. The polygons drawn by this function can overlap. pointsPerPolygon is an array with the number of points in each polygon  Google Microsoft
bool PolyPolyline(const POINT* arrayPoints, const DWORD* pointsPerPolygon, DWORD nCount)
It draws multiple series of connected line segments, pointsPerPolygon is an array with the number of points in each polygon  Google Microsoft
bool Polygon(const POINT* arrayPoints, int numbPoints)
It draws a polygon consisting of two or more vertices connected by straight lines. The polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode.  Google Microsoft
bool Polyline(const POINT* arrayPoints, int nCount)
It draws a series of line segments by connecting the points in the specified array  Google Microsoft
bool PolylineTo(const POINT* arrayPoints, DWORD nCount)
It draws one or more straight lines PolylineTo moves the current position to the ending point of the last line. If the line segments drawn by this function form a closed figure, the figure is not filled.
bool SetViewportExtEx(int width, int height, SIZE* prevViewportExtent)
It sets the horizontal and vertical extents of the viewport
bool SetViewportOrgEx(int pixelsX, int pixelsY, POINT* prevViewportOrg)
It specifies which device point maps to the window origin (0,0)
bool SetWindowExtEx(int width, int height, SIZE* prevWindowExtent)
It sets the horizontal and vertical extents of the window
bool SetWindowOrgEx(int luX, int luY, POINT* prevWindowOrg)
It specifies which window point maps to the viewport origin (0,0)
bool TextOut(int x, int y, const wchar_t* text)
It draws text
bool TextOut(int x, int y, const wchar_t* text, int text_length)
It draws text
bool TextOut(int x, int y, const wstring& text)
It draws text
const RECT& GetRcPaint()
It returns the area that needs to be painted
double GetDotsPerInch()
double GetPixelsPerCentimeter()
Number of pixels per centimeter
double GetPixelsPerMillimeterX()
It retrieves the number of pixels per millimeter in X  Google Microsoft
double GetPixelsPerMillimeterY()
It retrieves the number of pixels per millimeter in Y  Google Microsoft
double GetPixelsPerPoint()
Number of pixels per point (72 points is 1 inch)
int FillRect(const RECT& rect, CG::Brush& brush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.
int FillRect(const RECT& rect, HBRUSH hBrush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.
int FillRect(int xLeft, int yTop, int xRight, int yBottom, CG::Brush& brush)
It fills a rectangle by using the specified brush. This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.
int GetBkMode()
It returns the background mix mode: TRANSPARENT or OPAQUE
int GetDeviceCAPS(int index)
It retrieves device-specific information, index: DRIVERVERSION, TECHNOLOGY, HORZSIZE, VERTSIZE, HORZRES, VERTRES, LOGPIXELSX, LOGPIXELSY, BITSPIXEL, PLANES, NUMBRUSHES, NUMPENS, NUMFONTS, NUMCOLORS, ASPECTX, ASPECTY, ASPECTXY, PDEVICESIZE, CLIPCAPS, SIZEPALETTE, NUMRESERVED, COLORRES, PHYSICALWIDTH, PHYSICALHEIGHT, PHYSICALOFFSETX, PHYSICALOFFSETY VREFRESH, SCALINGFACTORX, SCALINGFACTORY, BLTALIGNMENT, SHADEBLENDCAPS, RASTERCAPS, CURVECAPS, LINECAPS POLYGONALCAPS, TEXTCAPS, COLORMGMTCAPS  Google Microsoft
int GetHorizontalDPI()
Number of pixels per logical inch along the screen width  Google Microsoft
int GetPhysicalHeight()
It returns the height of the pritable area and the page. For example, a printer set to print at 600 dpi on 8.5-x11-inch paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.  Google Microsoft
int GetPhysicalOffsetX()
It returns the horizontal offset from the printable area and the page  Google Microsoft
int GetPhysicalOffsetY()
It returns the horizontal offset from the printable area and the page  Google Microsoft
int GetPhysicalScreenHeight_mm()
Height, in millimeters, of the physical screen  Google Microsoft
int GetPhysicalScreenHeight_pixels()
Height, in raster lines, of the screen; or for printers, the height, in pixels, of the printable area of the page. Google Microsoft
int GetPhysicalScreenWidth_mm()
Width, in millimeters, of the physical screen  Google Microsoft
int GetPhysicalScreenWidth_pixels()
Width, in pixels, of the screen; or for printers, the width, in pixels, of the printable area of the page  Google Microsoft
int GetPhysicalWidth()
It returns the width of the pritable area and the page. For example, a printer set to print at 600 dpi on 8.5-x11-inch paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.  Google Microsoft
int GetTextWidth(const wchar_t* text)
It returns the width of the specified text
int GetVerticalDPI()
Number of pixels per logical inch along the screen height  Google Microsoft
int SaveDC()
It saves the current state of the specified device context (DC)
int SelectClippingRegion(CG::Region& region)
It selects a region as the current clipping region It returns: NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR To remove a device-context's clipping region, specify a nullptr region handle  Google Microsoft
int SetBkMode(bool isTransparent)
It sets the background mix mode
unsigned int GetTextAlign()
The GetTextAlign function retrieves the text-alignment setting for the specified device context. It returns a OR combination of: TA_CENTER, TA_LEFT, TA_RIGHT, TA_BASELINE, TA_BOTTOM, TA_TOP
unsigned int SetTextAlign(unsigned int textAlign)
textAlign is a combination of TA_CENTER, TA_LEFT, TA_RIGHT, TA_BASELINE, TA_BOTTOM, TA_TOP
void Arc(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a circular arc
void Chord(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a chord (a region bounded by the intersection of a circle and a line segment, called a secant). The chord is outlined by using the current pen and filled by using the current brush.  Google Microsoft
void Cilinder(int x, int y, double radius, double height, bool topEllipse, bool bottomEllipse)
void DrawArrow(const RECT& rect, int direction)
directin: WIN_DRAWARROW_NORTH, WIN_DRAWARROW_EAST, WIN_DRAWARROW_SOUTH, WIN_DRAWARROW_WEST
void DrawCaptionFrame(const RECT& rect, UINT style)
style: DFCS_CAPTIONCLOSE, DFCS_CAPTIONMIN, DFCS_CAPTIONMAX, DFCS_CAPTIONRESTORE DFCS_CAPTIONHELP OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT
void DrawFrameControl(const RECT& rect, UINT type, UINT style)
It draws a frame control of the specified type and style type: DFC_BUTTON, DFC_CAPTION, DFC_MENU, DFC_POPUPMENU, DFC_SCROLL style: DFCS_BUTTON3STATE, DFCS_BUTTONCHECK, DFCS_BUTTONPUSH,DFCS_BUTTONRADIO DFCS_BUTTONRADIOIMAGE, DFCS_BUTTONRADIOMASK, DFCS_CAPTIONCLOSE DFCS_CAPTIONHELP, DFCS_CAPTIONMAX, DFCS_CAPTIONMIN, DFCS_CAPTIONRESTORE
void DrawGraphics(Sys::Graphics& graphics, int x, int y)
void DrawGraphics(Sys::Graphics& graphics, int x, int y, int width, int height)
void DrawMenuFrame(const RECT& rect, UINT style)
style: DFCS_MENUARROW, DFCS_MENUCHECK, DFCS_MENUBULLET, DFCS_MENUARROWRIGHT OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT
void DrawScrollFrame(const RECT& rect, UINT style)
style: DFCS_SCROLLUP, DFCS_SCROLLDOWN, DFCS_SCROLLLEFT, DFCS_SCROLLRIGHT DFCS_SCROLLCOMBOBOX, DFCS_SCROLLSIZEGRIP, DFCS_SCROLLSIZEGRIPRIGHT OR: DFCS_CHECKED, DFCS_FLAT, DFCS_HOT, DFCS_INACTIVE, DFCS_MONO, DFCS_PUSHED, DFCS_TRANSPARENT
void DrawWindowCaption(const RECT& rect, UINT flags)
flags: DC_ACTIVE, DC_BUTTONS, DC_GRADIENT, DC_ICON, DC_INBUTTON, DC_SMALLCAP, DC_TEXT It draws a window caption
void PageSetup(int paperSize, bool isPortrait)
void Pie(double centerX, double centerY, double radius, double startAngleDegrees, double endAngleDegrees)
It draws a pie-shaped wedge bounded by the intersection of a circle and two radials. The pie is outlined by using the current pen and filled by using the current brush.
void RemoveClippingRegion()
void RestoreDC(int state)
It restores a device context (DC) to the last call to SaveDC, the state value is ignored
void SetDotsPerInch(double dpi)
void SolidCilinder(int x, int y, double radius, double height, COLORREF color)
You may want to select the nullptr pen before calling SolidCilinder
void TextOut(const RECT& rect, const wchar_t* text)
It draws text centered inside a rectangle
void TextOut(const RECT& rect, const wstring& text)
It draws text centered inside a rectangle
~ PdfGdi()
double DotsPerInch

Pen
HPEN Create(int penStyle, int width, COLORREF color)
HPEN GetHPEN()
Pen()
Pen(int nPenStyle, int nWidth, COLORREF color)
const LOGPEN& GetLogPen() const
virtual ~ Pen(void)
void Delete()

PointF
PointF(void)
virtual ~ PointF(void)
void SetFromPoint(POINT& pt)

Region
HRGN CreateElliptic(const RECT& rect)
It creates an ellipical region  Google Microsoft
HRGN CreateElliptic(int left, int top, int right, int bottom)
It creates an ellipical region  Google Microsoft
HRGN CreatePolyPolygon(const POINT* points, const int* pointsPerPolygon, int numPolygons, int polyFillMode)
polyFillMode: ALTERNATE, WINDING It creates a region consisting of a series of polygons. The polygons can overlap  Google Microsoft
HRGN CreatePolygon(const POINT* points, int numPoints, int polyFillMode)
polyFillMode: ALTERNATE, WINDING It creates a polygonal region  Google Microsoft
HRGN CreateRect(const RECT& rect)
It creates a rectangular region  Google Microsoft
HRGN CreateRect(int left, int top, int right, int bottom)
It creates a rectangular region  Google Microsoft
HRGN CreateRoundRect(int left, int top, int right, int bottom, int widthEllipse, int heightEllipse)
It creates a rectangular region  Google Microsoft
HRGN GetHRGN() const
Region()
bool IsPointInRegion(int x, int y)
It determines whether the specified point is inside the region  Google Microsoft
bool IsRectangleInRegion(const RECT& rect)
It determines whether any part of the specified rectangle is within the boundaries of a region  Google Microsoft
bool IsValid() const
bool operator ==(const CG::Region& init)const
int Combine(CG::Region& region1, CG::Region& region2, int mode)
It returns NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR mode: RGN_AND, RGN_COPY, RGN_DIFF, RGN_OR, RGN_XOR The region is the combination of region1 and region2  Google Microsoft
int GetBox(RECT& out_rect)
It returns NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR It retrieves the bounding rectangle of the specified region  Google Microsoft
int Offset(int offsetX, int offsetY)
It returns NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR It moves a region by the specified offsets  Google Microsoft
virtual ~ Region(void)
void Delete()
void Set(HRGN hRgn)
The regions is not destroyed

TextExtent
TextExtent(HDC hdc)
double GetWidth(const wchar_t* text)
double GetWidth(const wchar_t* text, int length)
static LONG GetHeight(int font)
virtual ~ TextExtent(void)

TextLine
TextLine()
~ TextLine()
© Copyright 2000-2021 selo. All Rights Reserved. Jul 22 2021.